<?php
/**
 * 
 * 
 * $Rev: 5 $
 * $Author: thejahweh $
 * $Date: 2010-07-23 06:15:20 +0000 (Fri, 23 Jul 2010) $
 * $Id: module.class.php 5 2010-07-23 06:15:20Z thejahweh $
 * $URL: http://allone.googlecode.com/svn/trunk/plugins/module/module.class.php $
 * @author: Adrian Liechti <info@jahweh.ch>
 * @copyright: 2010 Adrian Liechti, GPL3 and CC3 BY-SA
 */

abstract class module {
	
	protected $output;
	public $id;
	public $module_id;
	public $area_id;
	public $navigation_node_id;
	public $name;
	public $class_name;
	public $plugin_name;
	public $path;
	public $sort;
	public $position;
	public $useable;
	public $isLoaded = false;
	
	public function __construct () {}
	
	abstract public function display ();
	
	public function getModule (array $moduleArray) {
		$this->module_id			= $moduleArray['module_id'];
		$this->area_id				= $moduleArray['area_id'];
		$this->id					= $moduleArray['resident_modules_id'];
		$this->navigation_node_id	= $moduleArray['navigation_node_id'];
		$this->name					= $moduleArray['name'];
		$this->class_name			= $moduleArray['class_name'];
		$this->plugin_name			= $moduleArray['plugin_name'];
		$this->path					= $moduleArray['path'];
		$this->sort					= $moduleArray['sort'];
		$this->position				= $moduleArray['position'];
		$this->useable				= $moduleArray['useable'];
		$this->output->assign		('t', $this);
		return $this->isLoaded		= true;
	}

	public function setOutput ($outputClass) {
		if ($this->output === NULL) $this->output =& $outputClass;
	}
	
}
?>